import logging

from conf.config import AppConf
from funcall.baidu_search_fun_call import baidu_search_fun_call
from funcall.execute_shell_fun_call import execute_shell_fun_call
from funcall.file_editing_fun_call import file_editing_fun_call
from funcall.file_text_read_fun_call import file_text_read_fun_call
from funcall.get_current_time_fun_call import get_current_time_fun_call
from funcall.get_current_weather_fun_call import get_current_weather_fun_call
from funcall.java_fun_call import java_fun_call
from funcall.javac_fun_call import javac_fun_call
from funcall.access_www_fun_call import access_www_fun_call
from funcall.searx_fun_call import searx_fun_call
from utils.dict_utils import get_dict_value

funcall_log=logging.getLogger("funcall")
def fcs():
    fcs = []
    # fcs.append(get_current_weather_fun_call())
    # fcs.append(get_current_time_fun_call())
    fcs.append(file_editing_fun_call())
    fcs.append(execute_shell_fun_call())
    if get_dict_value(AppConf, 'ai.funcall.jdk') is not None:
        fcs.append(javac_fun_call())
        fcs.append(java_fun_call())
    else:
        funcall_log.warn("app.yaml中未配置jdk路径,javac_fun_call和java_fun_call不启用")

    fcs.append(file_text_read_fun_call())
    # fcs.append(searx_fun_call())
    fcs.append(baidu_search_fun_call())
    fcs.append(access_www_fun_call())
    return fcs
